package model;

import java.awt.event.KeyEvent;

public class JugadorDerecha extends Jugador { 
	
	public JugadorDerecha(int x, int y, int width, int height) {
		super(x, y, width, height);
	}
	
	public void keyPressed(KeyEvent key) {
		int tecla = key.getKeyCode();
		
		if(this.getY() > 8 + (this.getHeight()/2)) {
			if (tecla == KeyEvent.VK_O) {
				this.setY(this.getY() - 20);
			}
		}
		
		if (this.getY() < 430 - (this.getHeight()/2)) {
			if(tecla == KeyEvent.VK_L) {
				this.setY(this.getY() + 20);
			}
		}
		
	}
	
}
